package com.hotel.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName ht_reservation
 */
@TableName(value ="ht_reservation")
@Data
public class HtReservation implements Serializable {
    /**
     * 预定单号，主键
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String reservationNo;

    /**
     * 客房编号
     */
    private Long roomNo;

    /**
     * 客房类型，根据客房编号，自动显示
     */
    private Long roomTypeNo;

    /**
     * 标准价，根据客房编号，自动显示
     */
    private Double standardPrice;

    /**
     * 折后价，根据客房编号，自动显示
     */
    private Double discountedPrice;

    /**
     * 押金
     */
    private Double cashPledge;

    /**
     * 预定人
     */
    private String person;

    /**
     * 证件类别
     */
    private String idType;

    /**
     * 证件号码
     */
    private String idNumber;

    /**
     * 联系电话
     */
    private String phone;

    /**
     * 抵店时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date arrivalTime;

    /**
     * 离店时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date departureTime;

    /**
     * 入住人数
     */
    private Integer occupancyNumber;

    /**
     * 操作员
     */
    private String operator;

    /**
     * 会员编号
     */
    private Long memberNo;

    /**
     * 会员价，根据客房编号，自动显示
     */
    private Double membershipPrice;

    /**
     * 房间状态，正常、已取消、已入住，查询时，显示该项
     */
    private String statusNo;

    /**
     * 备注
     */
    private String reservationRemark;

    @TableField(exist = false)
    private String statusName;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        HtReservation other = (HtReservation) that;
        return (this.getReservationNo() == null ? other.getReservationNo() == null : this.getReservationNo().equals(other.getReservationNo()))
            && (this.getRoomNo() == null ? other.getRoomNo() == null : this.getRoomNo().equals(other.getRoomNo()))
            && (this.getRoomTypeNo() == null ? other.getRoomTypeNo() == null : this.getRoomTypeNo().equals(other.getRoomTypeNo()))
            && (this.getStandardPrice() == null ? other.getStandardPrice() == null : this.getStandardPrice().equals(other.getStandardPrice()))
            && (this.getDiscountedPrice() == null ? other.getDiscountedPrice() == null : this.getDiscountedPrice().equals(other.getDiscountedPrice()))
            && (this.getCashPledge() == null ? other.getCashPledge() == null : this.getCashPledge().equals(other.getCashPledge()))
            && (this.getPerson() == null ? other.getPerson() == null : this.getPerson().equals(other.getPerson()))
            && (this.getIdType() == null ? other.getIdType() == null : this.getIdType().equals(other.getIdType()))
            && (this.getIdNumber() == null ? other.getIdNumber() == null : this.getIdNumber().equals(other.getIdNumber()))
            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
            && (this.getArrivalTime() == null ? other.getArrivalTime() == null : this.getArrivalTime().equals(other.getArrivalTime()))
            && (this.getDepartureTime() == null ? other.getDepartureTime() == null : this.getDepartureTime().equals(other.getDepartureTime()))
            && (this.getOccupancyNumber() == null ? other.getOccupancyNumber() == null : this.getOccupancyNumber().equals(other.getOccupancyNumber()))
            && (this.getOperator() == null ? other.getOperator() == null : this.getOperator().equals(other.getOperator()))
            && (this.getMemberNo() == null ? other.getMemberNo() == null : this.getMemberNo().equals(other.getMemberNo()))
            && (this.getMembershipPrice() == null ? other.getMembershipPrice() == null : this.getMembershipPrice().equals(other.getMembershipPrice()))
            && (this.getStatusNo() == null ? other.getStatusNo() == null : this.getStatusNo().equals(other.getStatusNo()))
            && (this.getReservationRemark() == null ? other.getReservationRemark() == null : this.getReservationRemark().equals(other.getReservationRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getReservationNo() == null) ? 0 : getReservationNo().hashCode());
        result = prime * result + ((getRoomNo() == null) ? 0 : getRoomNo().hashCode());
        result = prime * result + ((getRoomTypeNo() == null) ? 0 : getRoomTypeNo().hashCode());
        result = prime * result + ((getStandardPrice() == null) ? 0 : getStandardPrice().hashCode());
        result = prime * result + ((getDiscountedPrice() == null) ? 0 : getDiscountedPrice().hashCode());
        result = prime * result + ((getCashPledge() == null) ? 0 : getCashPledge().hashCode());
        result = prime * result + ((getPerson() == null) ? 0 : getPerson().hashCode());
        result = prime * result + ((getIdType() == null) ? 0 : getIdType().hashCode());
        result = prime * result + ((getIdNumber() == null) ? 0 : getIdNumber().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getArrivalTime() == null) ? 0 : getArrivalTime().hashCode());
        result = prime * result + ((getDepartureTime() == null) ? 0 : getDepartureTime().hashCode());
        result = prime * result + ((getOccupancyNumber() == null) ? 0 : getOccupancyNumber().hashCode());
        result = prime * result + ((getOperator() == null) ? 0 : getOperator().hashCode());
        result = prime * result + ((getMemberNo() == null) ? 0 : getMemberNo().hashCode());
        result = prime * result + ((getMembershipPrice() == null) ? 0 : getMembershipPrice().hashCode());
        result = prime * result + ((getStatusNo() == null) ? 0 : getStatusNo().hashCode());
        result = prime * result + ((getReservationRemark() == null) ? 0 : getReservationRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", reservationNo=").append(reservationNo);
        sb.append(", roomNo=").append(roomNo);
        sb.append(", roomTypeNo=").append(roomTypeNo);
        sb.append(", standardPrice=").append(standardPrice);
        sb.append(", discountedPrice=").append(discountedPrice);
        sb.append(", cashPledge=").append(cashPledge);
        sb.append(", person=").append(person);
        sb.append(", idType=").append(idType);
        sb.append(", idNumber=").append(idNumber);
        sb.append(", phone=").append(phone);
        sb.append(", arrivalTime=").append(arrivalTime);
        sb.append(", departureTime=").append(departureTime);
        sb.append(", occupancyNumber=").append(occupancyNumber);
        sb.append(", operator=").append(operator);
        sb.append(", memberNo=").append(memberNo);
        sb.append(", membershipPrice=").append(membershipPrice);
        sb.append(", statusNo=").append(statusNo);
        sb.append(", reservationRemark=").append(reservationRemark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}